package com.hl.reflect;


import lombok.Data;

import java.io.IOException;

@Data
public class Student {
    private String name;
    private int age;
    public String gender;

    public Student() {
    }

    public Student(String name) {
        this.name = name;
    }

    protected Student(int age) {
        this.age = age;
    }

    private Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Student(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public void walk() {
        System.out.println("walking");
    }

    private void sleep() {
        System.out.println("sleeping");
    }

    private String eat(String food) throws IOException, NullPointerException {
        System.out.println("eating " + food);
        return "ok";
    }

    private void eat(int food) {
        System.out.println("eating " + food);
    }

    public String study(String subject) {
        System.out.println("studying " + subject);
        return "over";
    }
}
